package com.day08;

/**
 * 写一个名为Account的类似账户，该类的属性和方法如下图所示，该类包括的属性:
 * 账号id, 余额balance,年利率annuallnteregsRate,包含访问器方法get和set,返回月利率的方法，取款方法，存款方法。
 */
public class Account {
    private int id;  //账号
    private double balance; //余额
    private double annuallnteregsRate; //年利率


    public Account(int id, double balance, double annuallnteregsRate) {
        this.id = id;
        this.balance = balance;
        this.annuallnteregsRate = annuallnteregsRate;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public double getAnnuallnteregsRate() {
        return annuallnteregsRate;
    }

    public void setAnnuallnteregsRate(double annuallnteregsRate) {
        this.annuallnteregsRate = annuallnteregsRate;
    }


    //返回月利率
    public double getMonthlyUnterest() {
        return annuallnteregsRate / 12;
    }


}
